//
//  DGPopoverView.h
//  DGPopoverView
//
//  Created by Jinxiao on 12/10/14.
//  Copyright (c) 2014 debugeek. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, DGPopoverViewAnimationOptions) {
    DGPopoverViewAnimationOptionDownward = 1 << 0,
    DGPopoverViewAnimationOptionUpward = 1 << 1,
    DGPopoverViewAnimationOptionRightward = 1 << 2,
    DGPopoverViewAnimationOptionLeftward = 1 << 3,
    DGPopoverViewAnimationOptionFadeInOut = 1 << 4,
};

typedef NS_ENUM(NSUInteger, DGPopoverViewBackgroundStyle) {
    DGPopoverViewBackgroundStyleNone,
    DGPopoverViewBackgroundStyleDimmed,
    DGPopoverViewBackgroundStyleBlurLight,
    DGPopoverViewBackgroundStyleBlurDark
};
@protocol DGPopoverViewDelegate <NSObject>

- (void)dismissPopoverView;

@end
@interface DGPopoverView : UIView

- (instancetype)initWithContainerView:(UIView *)containerView contentView:(UIView *)contentView options:(DGPopoverViewAnimationOptions)options backgroundStyle:(DGPopoverViewBackgroundStyle)backgroundStyle;

- (void)displayAnimated:(BOOL)animated completion:(void (^)(void))completion;
- (void)dismissAnimated:(BOOL)animated completion:(void (^)(void))completion;

- (void)toggleAnimated:(BOOL)animated completion:(void (^)(void))completion;

@property (readonly) BOOL toggled;

@property (readwrite, nonatomic, assign) BOOL dismissible;

@property (readwrite, nonatomic, assign) BOOL interactive;

@property (readwrite, nonatomic, strong) void (^willDisplayBlock) (void);
@property (readwrite, nonatomic, strong) void (^didDisplayBlock) (void);
@property (readwrite, nonatomic, strong) void (^willDismissBlock) (void);
@property (readwrite, nonatomic, strong) void (^didDismissBlock) (void);

@property (readonly) UIView *contentView;

@property (nonatomic,weak) id<DGPopoverViewDelegate> delegate;

@property (nonatomic,assign) BOOL isClickBg;

@end
